#include"tcpserver.hpp"
#include<memory>
#include"Daemon.hpp"

void Usage(char* argv)
{
    std::cout << "Usage: " << argv << " port" << std::endl;
}

int main(int argc,char* argv[])
{
    if(argc != 2)
    {
        Usage(argv[0]);
        exit(UsageErr);
    }

    Daemon();
    uint16_t port = std::stoi(argv[1]);
    std::unique_ptr<TcpServer> tcp(new TcpServer(port));
    tcp->initServer();
    tcp->start();

    return 0;
}